<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDomainInduceOtherTable extends Migration {
    public function up() {
        Schema::create('domain_induce_condition', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->comment('分组名称');
            $table->string('table')->comment('表名');
            $table->string('key')->comment('字段键');
            $table->boolean('show')->default(false)->comment('是否显示');
            $table->unsignedInteger('width')->default(100)->comment('显示宽度');
            $table->boolean('back_end')->default(true)->comment('后台显示');
            $table->string('show_value')->default('')->comment('显示指定值');
            $table->tinyInteger('sort')->default(50)->comment('排序');
        });
        Schema::create('domain_induce_key_name', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('table')->comment('表名');
            $table->string('table_name')->comment('表显示名称');
            $table->string('key')->unique()->comment('键');
            $table->string('name')->unique()->comment('键显示名称');
        });
    }

    public function down() {
        Schema::dropIfExists('domain_induce_condition');
        Schema::dropIfExists('domain_induce_key_name');
    }
}
